package org.jeecg.modules.api;

import org.jeecg.common.api.vo.Result;
import org.jeecg.common.constant.ServiceNameConstants;
import org.jeecg.modules.api.factory.ManageBaseAPIFallbackFactory;
import org.jeecg.modules.manage.entity.CaishuiTaskSettle;
import org.jeecg.modules.manage.vo.ServiceFeeVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 *
 */
@Component
@FeignClient(contextId = "manageBaseRemoteApi", value = ServiceNameConstants.SERVICE_MANAGE, fallbackFactory = ManageBaseAPIFallbackFactory.class)
public interface IManageBaseAPI {


    /**
     * 下发（招行银企直连）
     * @param caishuiTaskSettle
     * @return
     */
    @PostMapping("/manageApi/caishuiTaskSettle/doIssuedSalary")
    Result<?> doIssuedSalary(@RequestBody CaishuiTaskSettle caishuiTaskSettle);

    /**
     * 处理下发批次与明细查询
     * @param orderNo
     * @return
     */
    @GetMapping("/manageApi/caishuiTaskSettle/handleTaskSettle")
    Result<?> handleTaskSettle(@RequestParam(name = "orderNo", required = true) String orderNo);

    /**
     * 计算下发服务费
     * @param idCard
     * @param amount
     * @param taxRate
     * @param taxRateTwo
     * @return
     */
    @GetMapping("/manageApi/caishuiTaskSettle/handleServiceFee")
    Result<ServiceFeeVo> handleServiceFee(@RequestParam(name = "idCard", required = true) String idCard,
                                          @RequestParam(name = "amount", required = true) Double amount,
                                          @RequestParam(name = "taxRate", required = true) Double taxRate,
                                          @RequestParam(name = "taxRateTwo", required = true) Double taxRateTwo);

    /**
     * 查询退款结果
     * @param yurRef
     * @return
     */
    @GetMapping("/manageApi/caishuiRefundRecord/queryRefundResult")
    Result<?> queryRefundResult(@RequestParam(name = "yurRef", required = true) String yurRef);

}
